<?php

// DocRoot and PagesConf shoulld be available to load this controller 
$DocRoot = $_SERVER['DOCUMENT_ROOT'];
include_once "$DocRoot/woflow/conf/pages.inc.php";

class DefaultController
{
	public function page($pageName)
	{
		$conf = new PagesConf();
		$page = $conf->getPage($pageName);
		if (strstr($page, ".php")) 
		{
			global $DocRoot;
			include "$DocRoot/woflow/pages/$page";
		}
		else
		{
			global $DocRoot;
			print file_get_contents("$DocRoot/woflow/pages/".$page);
		}
	}
}

class ControllerFactory
{
	public function getController()
	{
		return new DefaultController();
	}
}


?>